home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_1 / root_loc.plo < prev    next >
Internet Message Format  |  1995-03-23  |  3KB

  1. From news@unixg.ubc.ca  Sun Mar 15 13:55:47 1992
  2. Received: from rodan.UU.NET by seq.uncwil.edu (5.61/1.35.cgs)
  3.     id AA14040; Sun, 15 Mar 92 13:55:47 -0500
  4. Received: from relay2.UU.NET by rodan.UU.NET with SMTP 
  5.     (5.61/UUNET-mail-drop) id AA00972; Sun, 15 Mar 92 13:55:30 -0500
  6. Received: from iskut.ucs.ubc.ca by relay2.UU.NET with SMTP 
  7.     (5.61/UUNET-internet-primary) id AA02836; Sun, 15 Mar 92 13:55:19 -0500
  8. Received: by iskut.ucs.ubc.ca (5.64+ida SGI beta/1.14)
  9.     id AA15815; Sun, 15 Mar 92 18:55:15 GMT
  10. Newsgroups: comp.sys.hp48,comp.sources.hp48
  11. Path: stat656
  12. From: stat656@unixg.ubc.ca (John Paul Morrison)
  13. Subject: Re: WANTED: Root Locus Plotter
  14. Message-Id: <1992Mar15.185512.15776@unixg.ubc.ca>
  15. Sender: news@unixg.ubc.ca (Usenet News Maintenance)
  16. Nntp-Posting-Host: chilko.ucs.ubc.ca
  17. Organization: University of British Columbia, Vancouver, B.C., Canada
  18. References: <1992Mar14.024137.2098@gn.ecn.purdue.edu>
  19. Date: Sun, 15 Mar 1992 18:55:12 GMT
  20. Apparently-To: comp-sources-hp48@uunet.uu.net
  21. Status: OR
  22.  
  23. In article <1992Mar14.024137.2098@gn.ecn.purdue.edu> jess@gn.ecn.purdue.edu (Jess M Holle) writes:
  24. >Does anyone know of a root locus plotter for the 48sx?
  25. >
  26. >Jess Holle
  27.  
  28. Root locus is pretty simple if you have Bill Wickes' PROOT progam,
  29. which takes a vector of coefficients and solves the roots of the polynomial.
  30.  
  31. Here's my quick and dirty Root Locus plotter. To use it, you must find
  32. a copy of PROOT (ftp from seq.uncwil.edu, in /hp48/math ). 
  33.  
  34.  
  35. RTLOC
  36.  
  37. \<< { # 0h # 0h } PVIEW C SZE EVAL \-> a b \Ge n
  38.   \<< a b
  39.     FOR k k 'K' STO C KC k * + PROOT OBJ\-> DROP 2 n
  40.       START PIXON
  41.       NEXT \Ge
  42.     STEP GRAPH
  43.   \>>
  44. \>>
  45.  
  46. CST @ this is  a custom menu you might find useful too
  47.  
  48. { ERASE XRNG YRNG RTLOC C KC PROOT }
  49.  
  50.  
  51. How to use:
  52.  
  53. example: you have a polynomial s^2 + (K+2)s + K
  54.  
  55. seperate the constant terms and the K terms into
  56.  
  57. s^2 + 2s + 0 and K(0s^2 + s + 1) which gives you the coefficient vectors:
  58.  
  59. C = [1 2 0] and KC = [0 1 1] (C and KC must be real, and the same dimension!)
  60.  
  61. store these vectors into 'C' and 'KC'
  62.  
  63. now put the range of K and epsilon on the stack and press RTLOC.
  64. 0 10 .1 RTLOC
  65.  
  66. You will now have a root locus plotting.
  67. Adjust the X and Y ranges of the plotter in order to see diferrent views of
  68. the complex plane. You will notice that I do not plot the axes; if I
  69. did, a root loci that started on the s axis or jw axis would be obscured.
  70.  
  71.  
  72. Usually you have 1 + KG(s)H(s) = 0
  73. write this as 1 + K N(s)/D(s) = 0
  74. and then D(s) + K N(s) = 0, where N and D are polynomials.
  75. D(s) will be your C and N(s) will be KC
  76.  
  77. After plotting, you can scroll around and look at critical points.
  78. Remember that you are looking at the s and jw axes, and you can't 
  79. see what K is directly. To find K, just substitute the value of s
  80. at the point you are interested in, and solve for K.
  81.  
  82. John Paul Morrison
  83. --
  84. __________________________________________________________________________
  85.  John Paul Morrison                     |
  86.  University of British Columbia, Canada |
  87.  Electrical Engineering                 |   .sig closed for repairs 
  88.  
  89.